/*
 * *******************************************************************
 *   @项目名称: BHex Android
 *   @文件名称: GADownloadHelpActivity.java
 *   @Date: 18-11-29 下午4:05
 *   @Author: ppzhao
 *   @Description:
 *   @Copyright（C）: 2018 BlueHelix Inc.   All rights reserved.
 *   注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的.
 *  *******************************************************************
 */

package io.bhex.app.account.ui;

import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;

import io.bhex.app.R;
import io.bhex.app.account.presenter.GADownloadHelpPresenter;
import io.bhex.app.base.BaseActivity;
import io.bhex.app.utils.IntentUtils;
import io.bhex.app.utils.SkinColorUtil;

/**
 * ================================================
 * 描   述：GA帮助引导下载
 * ================================================
 */

public class GADownloadHelpActivity extends BaseActivity<GADownloadHelpPresenter,GADownloadHelpPresenter.GADownloadHelpUI> implements GADownloadHelpPresenter.GADownloadHelpUI, View.OnClickListener {
    @Override
    protected int getContentView() {
        return R.layout.activity_ga_help_layout;
    }

    @Override
    protected GADownloadHelpPresenter createPresenter() {
        return new GADownloadHelpPresenter();
    }

    @Override
    protected GADownloadHelpPresenter.GADownloadHelpUI getUI() {
        return this;
    }

    @Override
    protected void initView() {
        super.initView();
        Toolbar toolbar= findViewById(R.id.toolbar);
        CollapsingToolbarLayout collapsingToolbarLayout= findViewById(R.id.collapsing_toolbar);
        // 硬编码黑白版Toolbar标题栏title字色
        collapsingToolbarLayout.setCollapsedTitleTextColor(SkinColorUtil.getDark(this));
        collapsingToolbarLayout.setExpandedTitleColor(SkinColorUtil.getDark(this));

        //显示返回按钮
        setSupportActionBar(toolbar);
        ActionBar actionBar=getSupportActionBar();
        if (actionBar!=null){
            actionBar.setDisplayHomeAsUpEnabled(true);
        }
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()){
            case android.R.id.home:
                finish();
                break;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    protected void addEvent() {
        super.addEvent();
        viewFinder.find(R.id.btn_nextstep).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_nextstep:
                finish();
                IntentUtils.goBindGAHelp2(this);
                break;
        }
    }

    @Override
    public void onPointerCaptureChanged(boolean hasCapture) {

    }
}
